<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="./template.xhtml">

    <ui:define name="title">
        Xem MO/MT trong ngày
    </ui:define>

    <ui:define name="content">
        <h:form>
            <p:dataTable value="#{recvSmsBean.list}" var="item" paginator="#{recvSmsBean.list.size() >20}" rows="20"
                         emptyMessage="Không có dữ liệu MO hôm nay">

                <f:facet name="header">  
                    Dữ liệu MO
                </f:facet> 

                <p:column headerText="Đầu số" sortBy="#{item.srcaddr}"
                          filterBy="#{item.srcaddr}" filterMatchMode="contains">
                    #{item.srcaddr}
                </p:column>
                <p:column headerText="Tin nhắn" sortBy="#{item.message}"
                          filterBy="#{item.message}" filterMatchMode="contains">
                    #{item.message}
                </p:column>
                <p:column headerText="Giờ nhận" sortBy="#{item.recvTime}">
                    <h:outputText value="#{item.recvTime}">
                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" timeZone="Asia/Saigon"/>
                    </h:outputText>
                </p:column>
                <p:column headerText="Msisdn" sortBy="#{item.msisdn}"
                          filterBy="#{item.msisdn}" filterMatchMode="contains">
                    #{item.msisdn}
                </p:column>
                <p:column headerText="Mạng" sortBy="#{item.callbackId}"
                          filterBy="#{item.callbackId.substring(8)}" filterMatchMode="contains">
                    #{item.callbackId.substring(8)}
                </p:column>
            </p:dataTable>
            
            <br/>
            
            <p:dataTable value="#{sendsmsBean.list}" var="item" paginator="#{sendsmsBean.list.size() >20}" rows="20"
                         emptyMessage="Không có dữ liệu MT hôm nay">

                <f:facet name="header">  
                    Dữ liệu MT
                </f:facet> 

                <p:column headerText="Đầu số" sortBy="#{item.srcaddr}"
                          filterBy="#{item.srcaddr}" filterMatchMode="contains">
                    #{item.srcaddr}
                </p:column>
                <p:column headerText="Tin nhắn" sortBy="#{item.message}"
                          filterBy="#{item.message}" filterMatchMode="contains">
                    #{item.message}
                </p:column>
                <p:column headerText="Giờ nhận" sortBy="#{item.sendtime}">
                    <h:outputText value="#{item.sendtime}">
                        <f:convertDateTime pattern="dd/MM/yyyy HH:mm:ss" timeZone="Asia/Saigon"/>
                    </h:outputText>
                </p:column>
                <p:column headerText="Msisdn" sortBy="#{item.msisdn}"
                          filterBy="#{item.msisdn}" filterMatchMode="contains">
                    #{item.msisdn}
                </p:column>
                <p:column headerText="Mạng" sortBy="#{item.callbackId}"
                          filterBy="#{item.callbackId.substring(8)}" filterMatchMode="contains">
                    #{item.callbackId.substring(8)}
                </p:column>
            </p:dataTable>
        </h:form>
    </ui:define>

</ui:composition>
